<template>
  <el-dialog title="用药模板" v-model="d.isVisible" width="1200px">
    <el-form label-width="100px">
      <el-row :gutter="50">
        <el-col :span="8">
          <xm-f-select
            label="治疗方案类别:"
            :options="treatmentPlans"
            @change="() => (form.controlLevel = '')"
          ></xm-f-select>
        </el-col>
        <el-col :span="8">
          <xm-f-select
            label="控制级别:"
            :options="fitterControlLevels(form)"
          ></xm-f-select>
        </el-col>
        <el-col :span="8">
          <xm-f-radio label="模板类型" :options="templateTypes"></xm-f-radio>
        </el-col>
      </el-row>
      <el-row :gutter="50">
        <el-col :span="8">
          <xm-f-intput label="年龄:"></xm-f-intput>
        </el-col>
        <el-col :span="8">
          <xm-f-intput label="体重:"></xm-f-intput>
        </el-col>
        <el-col :span="8">
          <xm-f-select
            label="模板类型:"
            :options="treatmentPlans"
          ></xm-f-select>
        </el-col>
      </el-row>
      <el-row>
        <xm-f-intput label="模板说明:"></xm-f-intput>
      </el-row>
      <el-row>
        <el-form-item label="用药用法:">
          <el-table v-if="isSample">
            <XMTableColumn prop="medicineName" label="药物名称"></XMTableColumn>
            <XMTableColumn prop="medicineName" label="用量"></XMTableColumn>
            <XMTableColumn prop="medicineName" label="单位"></XMTableColumn>
            <XMTableColumn prop="medicineName" label="频次"></XMTableColumn>
            <XMTableColumn prop="medicineName" label="备注"></XMTableColumn>
            <XMTableColumn prop="medicineName" label="操作"></XMTableColumn>
          </el-table>
          <el-table v-else>
            <XMTableColumn prop="medicineName" label="药物名称"></XMTableColumn>
            <XMTableColumn prop="medicineName" label="单位"></XMTableColumn>
            <XMTableColumn prop="medicineName" label="绿区">
              <XMTableColumn prop="medicineName" label="用量"></XMTableColumn>
              <XMTableColumn prop="medicineName" label="频次"></XMTableColumn>
              <XMTableColumn prop="medicineName" label="备注"></XMTableColumn>
            </XMTableColumn>
            <XMTableColumn prop="medicineName" label="黄区">
              <XMTableColumn prop="medicineName" label="用量"></XMTableColumn>
              <XMTableColumn prop="medicineName" label="频次"></XMTableColumn>
              <XMTableColumn prop="medicineName" label="备注"></XMTableColumn>
            </XMTableColumn>
            <XMTableColumn prop="medicineName" label="红区">
              <XMTableColumn prop="medicineName" label="用量"></XMTableColumn>
              <XMTableColumn prop="medicineName" label="频次"></XMTableColumn>
              <XMTableColumn prop="medicineName" label="备注"></XMTableColumn>
            </XMTableColumn>
            <XMTableColumn prop="medicineName" label="用法"></XMTableColumn>
            <XMTableColumn prop="medicineName" label="操作"></XMTableColumn>
          </el-table>
        </el-form-item>
      </el-row>
    </el-form>
  </el-dialog>
</template>
<script>
  import { reactive, toRefs } from '@vue/reactivity'
  import emr from '@/hooks/emr'
  import { computed } from '@vue/runtime-core'
  export default {
    name: 'asthmaTemplateDialog',
    setup() {
      const d = reactive({ isVisible: false })

      const isSample = computed(() => {
        return false
      })
      const initData = function () {
        d.isVisible = true
      }
      return {
        d,
        initData,
        isSample,
        ...toRefs(emr()),
      }
    },
  }
</script>
